package il.ac.bgu.cs.heuristics.utils;

import junit.framework.Assert;
import junit.framework.TestCase;

public class StackSetTest extends TestCase {

	public void testStackSet1() {
		StackSet<Integer> ss = new StackSet();
		ss.push(new Integer(1));
		ss.push(new Integer(2));
		ss.push(new Integer(3));
		Assert.assertFalse(ss.push(new Integer(2)));
	}

	public void testStackSet2() {
		StackSet<Integer> ss = new StackSet();
		ss.push(new Integer(1));
		ss.push(new Integer(2));
		ss.push(new Integer(3));
		ss.pop();
		ss.pop();
		Assert.assertTrue(ss.push(new Integer(2)));
	}

	public void testStackSet3() {
		StackSet<Integer> ss = new StackSet();
		ss.push(new Integer(1));
		ss.push(new Integer(2));
		ss.push(new Integer(3));
		ss.pop();
		ss.pop();
		ss.push(new Integer(4));
		ss.push(new Integer(5));
		Assert.assertFalse(ss.push(new Integer(1)));
		Assert.assertEquals(3, ss.size());
	}
}
